//
// Created by Jisam on 2024/8/11 19:03.
// solve b
#include <bits/stdc++.h>

using namespace std;
#define  int long long
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> a(n), b(n + 1);
    b[0] = 1;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        b[i + 1] = b[i] * a[i] % 10;
    }
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
        if (b[i] % 10 == 6) {
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}